
pkgname=ca-certificates
pkgver=20180409
pkgrel=1
pkgdesc='Common CA certificates'
arch=('x86_64')
url='https://packages.qa.debian.org/c/ca-certificates.html'
license=('MPL' 'GPL')
depends=('bash' 'run-parts' 'openssl' 'findutils' 'coreutils' 'sed')
makedepends=('ruby' 'python2')
install=ca-certificates.install
backup=('etc/ca-certificates.conf')
source=("http://ftp.debian.org/debian/pool/main/c/${pkgname}/${pkgname}_${pkgver}.tar.xz")
md5sums=('8425f4b1219e4e528db2de764e4c6586')

build() {
  cd ${pkgname}

  make
}

package() {
  cd ${pkgname}

  install -d -m755 ${pkgdir}/{etc/ca-certificates/update.d,usr/{sbin,share/ca-certificates},etc/ssl/certs}
  make install DESTDIR=${pkgdir}
  install -D -m644 sbin/update-ca-certificates.8 ${pkgdir}/usr/share/man/man8/update-ca-certificates.8

  (
    echo "# Automatically generated by ${pkgname}-${pkgver}-${pkgrel}"
    echo "# see update-ca-certificates man page"
    echo "# "
    cd ${pkgdir}/usr/share/ca-certificates
    find . -name '*.crt' | sort | cut -b3-
  ) > ${pkgdir}/etc/ca-certificates.conf
}

